Skip to content

Conversation

alwx
Copy link
Contributor

@alwx alwx commented Sep 24, 2025

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Fixes #5187

📝 Checklist

  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing
  • No breaking changes

🔮 Next steps

Copy link
Contributor

github-actions bot commented Sep 24, 2025

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 441.10 ms 456.54 ms 15.44 ms
Size 17.75 MiB 19.70 MiB 1.95 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
f70acbf+dirty 373.39 ms 382.81 ms 9.43 ms
49ef936+dirty 405.96 ms 417.22 ms 11.26 ms
7be1f99 454.83 ms 461.36 ms 6.53 ms
000da7a 454.46 ms 445.00 ms -9.46 ms
bfe454a+dirty 573.44 ms 579.46 ms 6.02 ms
7480abe+dirty 411.60 ms 405.81 ms -5.78 ms
64cd15c 439.02 ms 427.63 ms -11.39 ms
23080e5 384.85 ms 382.57 ms -2.28 ms
5526494 440.84 ms 448.36 ms 7.52 ms
c08359e 421.87 ms 445.37 ms 23.50 ms

App size

Revision Plain With Sentry Diff
f70acbf+dirty 17.75 MiB 19.68 MiB 1.94 MiB
49ef936+dirty 17.75 MiB 19.69 MiB 1.94 MiB
7be1f99 17.75 MiB 20.15 MiB 2.41 MiB
000da7a 17.75 MiB 19.68 MiB 1.94 MiB
bfe454a+dirty 17.75 MiB 19.69 MiB 1.94 MiB
7480abe+dirty 17.75 MiB 19.68 MiB 1.94 MiB
64cd15c 17.75 MiB 20.15 MiB 2.41 MiB
23080e5 17.75 MiB 19.68 MiB 1.94 MiB
5526494 17.75 MiB 19.68 MiB 1.93 MiB
c08359e 17.75 MiB 20.15 MiB 2.41 MiB

Previous results on branch: alwx/bug/5187

Startup times

Revision Plain With Sentry Diff
05bd451+dirty 400.44 ms 420.96 ms 20.52 ms

App size

Revision Plain With Sentry Diff
05bd451+dirty 17.75 MiB 19.69 MiB 1.94 MiB

Copy link
Contributor

github-actions bot commented Sep 24, 2025

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 373.52 ms 419.48 ms 45.96 ms
Size 7.15 MiB 8.42 MiB 1.27 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
a0b15d6+dirty 414.33 ms 448.85 ms 34.52 ms
f70acbf+dirty 520.12 ms 558.91 ms 38.79 ms
49ef936+dirty 333.72 ms 387.51 ms 53.79 ms
bfe454a+dirty 372.42 ms 424.52 ms 52.10 ms
7480abe+dirty 363.80 ms 431.34 ms 67.54 ms
20d5eaa+dirty 358.31 ms 442.37 ms 84.06 ms
c4e097a+dirty 382.43 ms 443.77 ms 61.34 ms
7be1f99+dirty 369.02 ms 399.60 ms 30.58 ms
64cd15c+dirty 488.79 ms 483.54 ms -5.24 ms
534ba8c+dirty 472.35 ms 537.31 ms 64.96 ms

App size

Revision Plain With Sentry Diff
a0b15d6+dirty 7.15 MiB 8.42 MiB 1.27 MiB
f70acbf+dirty 7.15 MiB 8.41 MiB 1.26 MiB
49ef936+dirty 7.15 MiB 8.42 MiB 1.26 MiB
bfe454a+dirty 7.15 MiB 8.42 MiB 1.26 MiB
7480abe+dirty 7.15 MiB 8.41 MiB 1.26 MiB
20d5eaa+dirty 7.15 MiB 8.42 MiB 1.27 MiB
c4e097a+dirty 7.15 MiB 8.41 MiB 1.26 MiB
7be1f99+dirty 7.15 MiB 8.42 MiB 1.27 MiB
64cd15c+dirty 7.15 MiB 8.42 MiB 1.27 MiB
534ba8c+dirty 7.15 MiB 8.42 MiB 1.27 MiB

Previous results on branch: alwx/bug/5187

Startup times

Revision Plain With Sentry Diff
05bd451+dirty 302.20 ms 352.22 ms 50.02 ms

App size

Revision Plain With Sentry Diff
05bd451+dirty 7.15 MiB 8.42 MiB 1.26 MiB

Copy link
Contributor

github-actions bot commented Sep 24, 2025

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1216.77 ms 1236.21 ms 19.45 ms
Size 2.63 MiB 3.98 MiB 1.35 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
ec14be7+dirty 1234.64 ms 1245.54 ms 10.90 ms
d751a5d+dirty 1215.57 ms 1220.56 ms 4.99 ms
23080e5+dirty 1216.02 ms 1224.94 ms 8.91 ms
64cd15c+dirty 1216.31 ms 1214.04 ms -2.26 ms
77061ed+dirty 1233.16 ms 1234.88 ms 1.71 ms
ba75c7c+dirty 1235.86 ms 1226.45 ms -9.41 ms
95aaf8a+dirty 1234.78 ms 1241.94 ms 7.16 ms
98f632c+dirty 1236.40 ms 1241.62 ms 5.22 ms
534ba8c+dirty 1230.22 ms 1231.18 ms 0.96 ms
a31630c+dirty 1229.09 ms 1230.94 ms 1.85 ms

App size

Revision Plain With Sentry Diff
ec14be7+dirty 2.63 MiB 3.98 MiB 1.34 MiB
d751a5d+dirty 2.63 MiB 3.98 MiB 1.34 MiB
23080e5+dirty 2.63 MiB 3.91 MiB 1.28 MiB
64cd15c+dirty 2.63 MiB 3.81 MiB 1.18 MiB
77061ed+dirty 2.63 MiB 3.98 MiB 1.34 MiB
ba75c7c+dirty 2.63 MiB 3.81 MiB 1.18 MiB
95aaf8a+dirty 2.63 MiB 3.87 MiB 1.24 MiB
98f632c+dirty 2.63 MiB 3.81 MiB 1.18 MiB
534ba8c+dirty 2.63 MiB 3.81 MiB 1.18 MiB
a31630c+dirty 2.63 MiB 3.98 MiB 1.34 MiB

Previous results on branch: alwx/bug/5187

Startup times

Revision Plain With Sentry Diff
05bd451+dirty 1219.96 ms 1236.88 ms 16.92 ms

App size

Revision Plain With Sentry Diff
05bd451+dirty 2.63 MiB 3.98 MiB 1.34 MiB

Copy link
Contributor

github-actions bot commented Sep 24, 2025

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1239.33 ms 1234.75 ms -4.58 ms
Size 3.19 MiB 4.55 MiB 1.36 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
ec14be7+dirty 1229.62 ms 1230.53 ms 0.91 ms
d751a5d+dirty 1212.22 ms 1217.94 ms 5.71 ms
23080e5+dirty 1221.39 ms 1222.08 ms 0.70 ms
64cd15c+dirty 1213.50 ms 1223.54 ms 10.04 ms
77061ed+dirty 1210.77 ms 1218.45 ms 7.68 ms
ba75c7c+dirty 1236.14 ms 1240.69 ms 4.55 ms
95aaf8a+dirty 1206.83 ms 1213.65 ms 6.81 ms
98f632c+dirty 1221.38 ms 1229.26 ms 7.88 ms
534ba8c+dirty 1225.00 ms 1237.43 ms 12.43 ms
a31630c+dirty 1241.32 ms 1226.98 ms -14.34 ms

App size

Revision Plain With Sentry Diff
ec14be7+dirty 3.19 MiB 4.54 MiB 1.36 MiB
d751a5d+dirty 3.19 MiB 4.54 MiB 1.36 MiB
23080e5+dirty 3.19 MiB 4.48 MiB 1.29 MiB
64cd15c+dirty 3.19 MiB 4.38 MiB 1.19 MiB
77061ed+dirty 3.19 MiB 4.54 MiB 1.36 MiB
ba75c7c+dirty 3.19 MiB 4.38 MiB 1.19 MiB
95aaf8a+dirty 3.19 MiB 4.44 MiB 1.25 MiB
98f632c+dirty 3.19 MiB 4.38 MiB 1.19 MiB
534ba8c+dirty 3.19 MiB 4.38 MiB 1.19 MiB
a31630c+dirty 3.19 MiB 4.54 MiB 1.36 MiB

Previous results on branch: alwx/bug/5187

Startup times

Revision Plain With Sentry Diff
05bd451+dirty 1223.57 ms 1237.29 ms 13.72 ms

App size

Revision Plain With Sentry Diff
05bd451+dirty 3.19 MiB 4.54 MiB 1.36 MiB

@alwx alwx changed the title Fix the issue with changing immutable metadata structure in the contructor of ReactNativeClient WIP: Fix the issue with changing immutable metadata structure in the contructor of ReactNativeClient Sep 25, 2025
@alwx alwx marked this pull request as draft September 25, 2025 06:53
...options._metadata?.sdk?.settings,
},
},
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes follows the new implementation getsentry/sentry-javascript#17364

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but the issue here is that the metadata structure is immutable so instead of modifying it we can construct a new one, and that's what I'm doing in this PR. Other than that, the logic stays pretty much the same.

I've also updated tests to reflect that change and indiciate the expected behaviour which is the following:

  • If sendDefaultPii is true, Sentry will infer the IP address of users' devices to events (errors, traces, replays, etc) in all browser-based SDKs.
  • If sendDefaultPii is false or not set, Sentry will not infer or collect IP address data.

@alwx
Copy link
Contributor Author

alwx commented Sep 30, 2025

I've updated this PR and updated some tests that were not correct — all those tests were checking if infer_ip is set to never which should happen only if setDefaultPii is set to false.
There are no new tests added since there are already tests that check for infer_ip value. Those are the following:

  • does not add ip_address {{auto}} to undefined user if sendDefaultPii is false
  • doesn't change infer_ip if the ip_address is set to undefined (I've updated the name)
  • doesn't change infer_ip if the user is not set (I've updated the name)
  • doesn't change infer_ip if the event is empty

@alwx alwx changed the title WIP: Fix the issue with changing immutable metadata structure in the contructor of ReactNativeClient Fix the issue with changing immutable metadata structure in the contructor of ReactNativeClient Sep 30, 2025
@alwx alwx requested a review from lucas-zimerman September 30, 2025 08:43
@alwx alwx marked this pull request as ready for review September 30, 2025 08:44
Copy link
Contributor

@antonis antonis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change LGTM and handle the reported issue. My understanding is that it also does not break the sendDefaultPii fix. That said, I'm leaving the final approval to @lucas-zimerman who has more context on that patch.
We should also add a changelog entry since this is user facing and fixes an issue.

Copy link
Collaborator

@lucas-zimerman lucas-zimerman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should follow the quote pattern as it's used on the remaining tests.
Also after adding a changelog, LGTM!

@alwx alwx requested a review from antonis October 1, 2025 12:08
Copy link
Contributor

@antonis antonis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎸
Thank you for fixing this @alwx 🙇

@antonis
Copy link
Contributor

antonis commented Oct 1, 2025

If this is not a CI issue 😓 there seems to be an issue with the linter (ERROR: "lint:prettier" exited with 1.) which might be fixed with a yarn fix.

@lucas-zimerman
Copy link
Collaborator

If this is not a CI issue 😓 there seems to be an issue with the linter (ERROR: "lint:prettier" exited with 1.) which might be fixed with a yarn fix.

probably related to

  Error while parsing /home/runner/work/sentry-react-native/sentry-react-native/packages/core/node_modules/react-native/Libraries/Utilities/codegenNativeComponent.js
  Line 19, column 26: Property or signature expected.
  `parseForESLint` from parser `/home/runner/work/sentry-react-native/sentry-react-native/packages/core/node_modules/@typescript-eslint/parser/dist/index.js` is invalid and will just be ignored

@alwx alwx merged commit 170d5ea into main Oct 6, 2025
65 checks passed
@alwx alwx deleted the alwx/bug/5187 branch October 6, 2025 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants